Skip to main content
POST
Generate or edit an image with FLUX.2 [klein] 4B
The fastest and most affordable model, with open weights that run on consumer GPUs. 9B trades some speed for higher quality. See which model to use.

Authorizations

x-key
string
header
required

Body

application/json

Input model for FLUX.2 Klein (non-base) - like Pro but max 4 images.

prompt
string
required

Text prompt for image generation.

Example:

"ein fantastisches bild"

input_image
string | null

Path to the input image.

input_image_2
string | null

Path to the second input image.

input_image_3
string | null

Path to the third input image.

input_image_4
string | null

Path to the fourth input image.

seed
integer | null

Optional seed for reproducibility.

Example:

42

width
integer | null
default:0

Width of the image

Required range: x >= 64
height
integer | null
default:0

Height of the image

Required range: x >= 64
safety_tolerance
integer
default:2

Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict. If you wish to increase the safety_tolerance beyond these levels please reach out to the team.

Required range: 0 <= x <= 5
output_format
enum<string> | null
default:jpeg
Available options:
jpeg,
png,
webp
webhook_url
string<uri> | null

URL to receive webhook notifications

Required string length: 1 - 2083
webhook_secret
string | null

Optional secret for webhook signature verification

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)